<?php


namespace app\store\model;

use think\Model;

class GoodsItem extends Model
{
    protected $schema = [
        'id' => 'int',
        'goods_id' => 'int',
        'attr' => 'string',
        'image' => 'string',
        'market_price' => 'float',
        'subsidy_price' => 'float',
        'stock' => 'int',
        'sell_price' => 'float',
        'redeem_price' => 'int',
        'redeem_integral' => 'int',
        'redeem_stock' => 'int',
    ];

    public function setAttrAttr($value)
    {
        return join(';',$value);
    }


    public function getAttrAttr($value)
    {
        return explode(';',rtrim($value,';'));
    }
}